<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../style/ucs.css">
    <link rel="stylesheet" href="../content/font/iconfont.css">
    <link rel="stylesheet" href="../style/theme.css">
</head>
<body>
    <div id="giraffe"></div>
    <script type="text/javascript" src="../../dist/libs/u-eventhub.js"></script>
    <script type="text/javascript" src="../../dist/libs/engine.js"></script>
    <script type="text/javascript" src="../../dist/ucsmy-ui.js"></script>

    <script type="text/javascript">
        var MessageListDM = new UDM({
            value: [],
            readAjax: function(MessageId,callBack){
                console.log("已读"+MessageId);
                var flag = true;    //true：标记已读成功，false：标记已读失败
                callBack(MessageId,flag);
                realNameInfoDM.setValue({IsNew:false})
            },
            delAjax: function(ids){
                console.log(ids);
            }
        });

        //个人实名信息
        var realNameInfoDM = new UDM({
            value:{
                IsNew:0, //是否有新消息
                AccType:1,
                Mobile:"",
                IsBindMobile:true,//是否绑定手机
                BindMobileUrl:"../UserInfo/index.html",//绑定手机链接
                IsBindIDCard:false,//是否验证身份
                BindIDCardUrl:"../UserInfo/index.html",//验证身份链接
                IsBindBankCard:false,//是否绑卡
                BindBankCardUrl:"../MyBankCard/index.html",//绑卡链接
                Current:"FinanceMessage",  //当前选中菜单
                InvestAccountUrl:"../MyAccount/index.html",//投资账户总览链接
                InvestListUrl:"../MyInvest/index.html",//投资记录链接
                MyBankCardUrl:"../MyBankCard/index.html",//我的银行卡链接
                InvestInfoUrl:"../UserInfo/index.html",//投资个人信息
                InvestMessageUrl:"../UserMessageCenter/index.html",//投资消息中心
                FinanceAccountUrl:"../FinanceAccount/index.html",//融资账户总览链接
                FinanceListUrl:"../FinanceList/index.html",//融资记录链接
                FinanceAccountInfoUrl:"../AccountInfo/index.html",//融资账号信息
                FinanceMessageUrl:"../CompanyMessageCenter/index.html"//融资消息中心
            }
        })
        //分页条模型
        var paginationDM = new UDM({
            value: {	//默认值为0
                totalPage: 0,	//总页数
                pageSize: 2,	//每页显示条数
                curPage: 1	//当前页码
            },
            onClick:function(){
                ajaxFn();
            }
        });
        /*ajax请求数据*/
        var ajaxFn = function(){
            var pageSize = paginationDM.getValue().pageSize;	//获取每页显示条数
            var curPage = paginationDM.getValue().curPage;		//获取当前选中页码

            var MessageList = {
                TotalCount:4,
                MsgList: [
                    {
                        MessageId:"8031ef49-8b5e-4f97-90f4-ac570ab0d413",
                        UserId:"da5e0631-91f9-4bf5-a010-771c7bd92d80",
                        Content:"尊敬的客户，您在我行富乐e家投资的项目《信富乐盈【2016072602】》购买成功，投资金额1000.00元，预期收益6.24元，项目起息日：2016-08-06，项目到期日：2016-09-09。详细信息可登录后查询。",
                        ProjectId:"9311c4ac-490d-425f-b502-2685b28fab5b",
                        SendDate:"2016-08-09T10:05:39",
                        IsLooked:0,
                        Title:"SystemNotification",
                        IsDel:0
                    },
                    {
                        MessageId:"8031ef49-8b5e-4f97-90f4-ac570ab0",
                        UserId:"da5e0631-91f9-4bf5-a010-771c7bd92d80",
                        Content:"尊敬的客户，您在我行富乐e家投资的项目《信富乐盈【2016072602】》购买成功，投资金额1000.00元，预期收益6.24元，项目起息日：2016-08-06，项目到期日：2016-09-09。详细信息可登录后查询。",
                        ProjectId:"9311c4ac-490d-425f-b502-2685b28fab5b",
                        SendDate:"2016-08-09T10:05:39",
                        IsLooked:0,
                        Title:"SystemNotification",
                        IsDel:0
                    },
                    {
                        MessageId:"8031ef49-8b5e-4f97-90f4-acab0d413",
                        UserId:"da5e0631-91f9-4bf5-a010-771c7bd92d80",
                        Content:"尊敬的客户，您在我行富乐e家投资的项目《信富乐盈【2016072602】》购买成功，投资金额1000.00元，预期收益6.24元，项目起息日：2016-08-06，项目到期日：2016-09-09。详细信息可登录后查询。",
                        ProjectId:"9311c4ac-490d-425f-b502-2685b28fab5b",
                        SendDate:"2016-08-09T10:05:39",
                        IsLooked:0,
                        Title:"SystemNotification",
                        IsDel:0
                    },
                    {
                        MessageId:"8031ef49-5e-4f97-90f4-ac570ab0d413",
                        UserId:"da5e0631-91f9-4bf5-a010-771c7bd92d80",
                        Content:"投资金额1000.00元，预期收益6.24元，项目起息日：2016-08-06，项目到期日：2016-09-09。详细信息可登录后查询。尊敬的客户，您在我行富乐e家投资的项目《信富乐盈【2016072602】》购买成功，投资金额1000.00元，预期收益6.24元，项目起息日：2016-08-06，项目到期日：2016-09-09。详细信息可登录后查询。",
                        ProjectId:"9311c4ac-490d-425f-b502-2685b28fab5b",
                        SendDate:"2016-08-09T10:05:39",
                        IsLooked:0,
                        Title:"SystemNotification",
                        IsDel:0
                    }
                ]
            }

            var paginationValue = {
                totalPage: Math.ceil(MessageList.TotalCount/pageSize),	//总页数
                pageSize: pageSize,	//每页显示条数
                curPage: curPage	//当前页码
            }
            var curMessageList = [];
            if(MessageList.TotalCount>0){
                for(var i = curPage*pageSize - pageSize ; i < curPage*pageSize ; i ++){
                    curMessageList.push(MessageList.MsgList[i]);
                }
            }

            var realName = {
                AccType:1,
                Mobile:"155****2132",
                IsBindMobile:true,//是否绑定手机
                BindMobileUrl:"../UserInfo/index.html",//绑定手机链接
                IsBindIDCard:false,//是否验证身份
                BindIDCardUrl:"../UserInfo/index.html",//验证身份链接
                IsBindBankCard:false,//是否绑卡
                BindBankCardUrl:"../MyBankCard/index.html",//绑卡链接
                Current:"FinanceMessage",  //当前选中菜单
                InvestAccountUrl:"../MyAccount/index.html",//投资账户总览链接
                InvestListUrl:"../MyInvest/index.html",//投资记录链接
                MyBankCardUrl:"../MyBankCard/index.html",//我的银行卡链接
                InvestInfoUrl:"../UserInfo/index.html",//投资个人信息
                InvestMessageUrl:"../UserMessageCenter/index.html",//投资消息中心
                FinanceAccountUrl:"../FinanceAccount/index.html",//融资账户总览链接
                FinanceListUrl:"../FinanceList/index.html",//融资记录链接
                FinanceAccountInfoUrl:"../AccountInfo/index.html",//融资账号信息
                FinanceMessageUrl:"../CompanyMessageCenter/index.html"//融资消息中心
            }
            realNameInfoDM.setValue(realName);
            MessageListDM.setValue(curMessageList);
            paginationDM.setValue(paginationValue);
        };

        var PageDM = {
            MessageList: MessageListDM,
            pagination: paginationDM,
            realNameInfo: realNameInfoDM
        }
        UEventHub.on('pageLoad',function(){
            ajaxFn();
        });
    </script>
<script type="text/javascript" src="../CompanyMessageCenter\index.js"></script></body>
</html>